<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
    String path = request.getContextPath();
			String basePath = request.getScheme() + "://"
					+ request.getServerName() + ":" + request.getServerPort()
					+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户管理页面</title>
<link rel="icon" href="<%=basePath%>favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="<%=basePath%>favicon.ico" type="image/x-icon" />

<link rel="stylesheet" type="text/css" href="<%=basePath%>css/common.css"></link>
<link rel="stylesheet" type="text/css" href="<%=basePath%>css/user.css"></link>
<link rel="stylesheet" type="text/css" href="<%=basePath%>css/pageStyle.css" media="screen" ></link>

<script type="text/javascript" src="<%=basePath%>js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="<%=basePath%>js/jquery.paginate.js"></script>
<script type="text/javascript" src="<%=basePath%>js/user.js"></script>
<style type="text/css">
            .demo{
                width:460px;
                padding:10px;
                margin:10px auto;
                border: 1px solid #fff;
                background-color:#f7f7f7;
            }
</style>
</head>
<body>
    <a href="#none">index|首页</a>
    <a href="<%=basePath%>user/toQueryUser.action">userManager|用户管理</a>
    <a href="<%=basePath%>game/sudo/generate.action">game|游戏</a>
    <a href="#none">index|首页</a>
    <br>
    <hr>
    <div align="center">
        <form id="queryUserForm" action="user/queryUser.action" method="post">
            <table class="tableClass">
                <tr>
                    <td>用户ID</td>
                    <td><input id="user.userID" name="user.userID" value="<s:property value="user.userID"/>" /></td>
                    <td>用户名</td>
                    <td><input name="user.name" value="<s:property value="user.name"/>" /></td>
                    <td rowspan="2"><a href="#none" onclick="queryUserList();return false;">查询</a></td>
                </tr>
            </table>
        </form>
        <hr>
        <table class="tableClass" width="62%">
            <thead>
                <tr>
                    <th>UserID</th>
                    <th>UserName</th>
                    <th>age</th>
                    <th width="16%">action</th>
                </tr>
            </thead>
            <tbody>
                <s:iterator value="userList" status="userIndex">
                    <tr>
                        <td align="right"><s:property value="userID" /></td>
                        <td align="center"><s:property value="name" /></td>
                        <td align="center"><s:property value="age" /></td>
                        <td><a href="#none" id="viewUserInfo_<s:property value="#userIndex.index"/>"
                            onclick="viewUser(<s:property value="#userIndex.index"/>);return false;" onmousemove="start(this)" onmouseout="end(this)">查看</a><font
                            color="black">|</font><a href="#none" id="editUserInfo_<s:property value="#userIndex.index"/>"
                            onclick="editUser('<s:property value="userID"/>');return false;">编辑</a><font color="black">|</font><a href="#none"
                            id="delUserInfo_<s:property value="#userIndex.index"/>" onclick="delUser('<s:property value="userID"/>');return false;">删除</a></td>
                        <!-- 
						<td><button type="button">查看</button><button type="button">编辑</button><button type="button">删除</button></td>
						 -->
                    </tr>
                </s:iterator>

            </tbody>
        </table>
    </div>
			<div class="demo">
                <div id="demo4"></div>
            </div>
    <%--
        <s:debug></s:debug>
         --%>
    <center>
        <div id="userInfo" class="userInfo_hidden">
            <a id="userInfoClose" href="#none" onclick="$('#userInfo').hide();return false;">X</a>
            <h2>userInfo</h2>
            <s:iterator value="userList" var="usertmp" status="tmp">
                <div id="user_<s:property value="#tmp.index"/>" style="display: none">
                    <table>
                        <tr>
                            <td align="right">用户ID：</td>
                            <td align="left"><s:property value="userID" /></td>
                        </tr>
                        <tr>
                            <td align="right">用户姓名</td>
                            <td align="left"><s:property value="name" /></td>
                        </tr>
                        <tr>
                            <td align="right">年龄</td>
                            <td align="left"><s:property value="age" /></td>
                        </tr>
                        <tr>
                            <td align="right">性别</td>
                            <td align="left"><s:if test="gender==1">男</s:if> <s:elseif test="gender==0">女</s:elseif></td>
                        </tr>
                    </table>
                </div>
            </s:iterator>
        </div>
    </center>
</body>
		<script src="jquery.paginate.js" type="text/javascript"></script>
		<script type="text/javascript">
		$(function() {
			$("#demo4").paginate({
				count 		: 50,
				start 		: 20,
				display     : 12,
				border					: false,
				text_color  			: '#79B5E3',
				background_color    	: 'none',	
				text_hover_color  		: '#2573AF',
				background_hover_color	: 'none', 
				images		: false,
				mouse		: 'press'
			});
		});
		</script>
</script>
</html>
